﻿using System.ServiceModel;

namespace Ipmce.RemoteVoting.Common.Tools.Wcf.Unity.LifetimeManagers
{
	/// <summary>
	/// Unity lifetime manager to support <see cref="System.ServiceModel.InstanceContext"/>.
	/// </summary>
	public class UnityInstanceContextLifetimeManager : UnityWcfLifetimeManager<InstanceContext>
	{
		/// <summary>
		/// Returns the appropriate extension for the current lifetime manager.
		/// </summary>
		/// <returns>The registered extension for the current lifetime manager, otherwise, null if the extension is not registered.</returns>
		protected override UnityWcfExtension<InstanceContext> FindExtension()
		{
			return UnityInstanceContextExtension.Current;
		}
	}
}